package com.liezh.bridge;

/**
 * 具体实体
 * @author liezh
 * @date 2021-9-2
 */
public class SimpleFileUploaderImpl implements FileUploader {
    FileUploadExcutor excutor = null;

    public SimpleFileUploaderImpl(FileUploadExcutor excutor) {
        this.excutor = excutor;
    }

    @Override
    public Object upload(String path, Object file) {
        assert !check(file) : new RuntimeException("文件校验不通过");
        return excutor.uploadFile(path, file);
    }

    @Override
    public boolean check(Object file) {
        return excutor.checkFile(file);
    }
}
